package chapter_24_visitor.my;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by CharloYao on 2017/8/1.
 */
public class ObjectStructure {

    List<Element> list = new ArrayList<Element>();

    public void action(IVisitor visitor){
        for(Element element : list){
            element.accept(visitor);
        }
    }
    public void add(Element element){
        list.add(element);
    }
}
